<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<input id="attrId" name="attrId" class="form-control" type="hidden" th:value="${attrId}">
                                                                							                                                                <div class="form-group">	
								<label class="col-sm-3 control-label">属性名：</label>
								<div class="col-sm-8">
									<input id="attrFieldName" name="attrFieldName" class="form-control" type="text" placeholder="如(品种名称)">
								</div>
							</div>
														                                                                <!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">属性id：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="attrId" name="attrId" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
														                                                                <div class="form-group">	
								<label class="col-sm-3 control-label">类型：</label>
								<div class="col-sm-8">
									<!--<input id="type" name="type" class="form-control" type="text">-->
									<select id="type" name="type" class="form-control" onchange="isHiddenFieldValue()">
										<option value="2">文本</option>
										<option value="1">下拉框</option>

										<!--<option value="3">复选框</option>-->
										<option value="4">单选框</option>
									</select>
								</div>
							</div>
														                                                                <div class="form-group">	
								<label class="col-sm-3 control-label">默认值：</label>
								<div class="col-sm-8">
									<input id="tips" name="tips" class="form-control" type="text" placeholder="如(珍珠米)">
								</div>
							</div>
														                                                                <div class="form-group">	
								<label class="col-sm-3 control-label">排序：</label>
								<div class="col-sm-8">
									<input id="orderNum" name="orderNum" class="form-control" type="number">
								</div>
							</div>
							<div class="form-group" id="fieldValueDiv" hidden>
								<label class="col-sm-3 control-label">属性值：</label>
								<div class="col-sm-8">
									<!--<input id="fieldValue" name="fieldValue" class="form-control" type="number">-->
									<textarea id="fieldValue" name="fieldValue" class="form-control" placeholder="多个属性值用*号分割，如(红色*蓝色*紫色)"></textarea>
								</div>
							</div>
																					<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript">
		function isHiddenFieldValue() {
			var val = $("#type option:selected").val();
			if (val == 2){
			    $("#fieldValueDiv").hide()
			}
			if (val == 1|| val == 4){
				$("#fieldValueDiv").show()
			}
        }
	</script>
	<script type="text/javascript" src="/js/appjs/attr/attrField/add.js" th:src="@{/js/appjs/attr/attrField/add.js}">
	</script>
</body>
</html>
